﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using V5_Common;
using System.Text;

namespace V5_EShop.Admin {
    public partial class Admin_Index_Left : System.Web.UI.Page {
        protected void Page_Load(object sender, EventArgs e) {
            if (!this.IsPostBack) {
                string menu = InputHelper.SetString(Request["type"]);
                switch (menu.ToLower()) {
                    case "book":
                        this.LiteralMenuList.Text = Bind_Book();
                        break;
                    case "config":
                        this.LiteralMenuList.Text = Bind_Config();
                        break;
                    case "content":
                        this.LiteralMenuList.Text = Bind_Article();
                        break;
                    case "user":
                        this.LiteralMenuList.Text = Bind_Admin_User();
                        break;
                    case "template":
                        this.LiteralMenuList.Text = Bind_Admin_Template();
                        break;
                    default:
                        this.LiteralMenuList.Text = Bind_Book();
                        break;
                }
            }
        }

        private string Bind_Book() {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>图书管理</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""Book/Admin_Book.aspx"" target=""main"">图书管理</a></li>");
            sb.AppendLine(@"<li><a href=""Book/Admin_BookClass.aspx"" target=""main"">图书分类管理</a></li>");
            sb.AppendLine(@"<li><a href=""Book/Admin_BookComment.aspx"" target=""main"">图书评论管理</a></li>");
            sb.AppendLine(@"<li><a href=""Book/Admin_BookTopicClass.aspx"" target=""main"">图书专题分类</a></li>");
            sb.AppendLine(@"</ul>");
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>图书扩展管理</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""Book/Admin_BookIsbn.aspx"" target=""main"">Isbn管理</a></li>");
            sb.AppendLine(@"<li><a href=""Book/Admin_BookPub.aspx"" target=""main"">出版社管理</a></li>");
            sb.AppendLine(@"<li><a href=""Book/Admin_BookAuthor.aspx"" target=""main"">作者管理</a></li>");
            sb.AppendLine(@"</ul>");
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>订单管理</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""Shop/Admin_ShopOrder.aspx"" target=""main"">订单管理</a></li>");
            sb.AppendLine(@"<li><a href=""Shop/Admin_ShopArea.aspx"" target=""main"">地区管理</a></li>");
            sb.AppendLine(@"<li><a href=""Shop/Admin_ShopPayment.aspx"" target=""main"">支付方式管理</a></li>");
            sb.AppendLine(@"<li><a href=""Shop/Admin_ShopShipment.aspx"" target=""main"">发货方式管理</a></li>");
            sb.AppendLine(@"</ul>");
            return sb.ToString();
        }

        private string Bind_Config() {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>系统配置</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""Tools/Admin_Config.aspx"" target=""main"">网站配置</a></li>");
            sb.AppendLine(@"</ul>");
            //
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>帮助中心</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""Help/Admin_Help.aspx"" target=""main"">帮助中心</a></li>");
            sb.AppendLine(@"<li><a href=""Help/Admin_HelpClass.aspx"" target=""main"">帮助中心分类</a></li>");
            sb.AppendLine(@"</ul>");
            //
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>友情链接</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""Friend/Admin_Friend.aspx"" target=""main"">友情链接</a></li>");
            sb.AppendLine(@"<li><a href=""Friend/Admin_FriendClass.aspx"" target=""main"">友情链接分类</a></li>");
            sb.AppendLine(@"</ul>");
            //
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>热门关键字</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""HotKeyWord/Admin_HotKeyWord.aspx"" target=""main"">热门关键字</a></li>");
            sb.AppendLine(@"<li><a href=""HotKeyWord/Admin_HotKeyWordClass.aspx"" target=""main"">热门关键字分类</a></li>");
            sb.AppendLine(@"</ul>");
            return sb.ToString();
        }

        private string Bind_Article() {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>文章管理</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""Article/Admin_Article.aspx"" target=""main"">文章管理</a></li>");
            sb.AppendLine(@"<li><a href=""Article/Admin_ArticleClass.aspx"" target=""main"">文章分类管理</a></li>");
            sb.AppendLine(@"<li><a href=""Article/Admin_ArticleComment.aspx"" target=""main"">文章评论管理</a></li>");
            sb.AppendLine(@"<li><a href=""Article/Admin_ArticleTopicClass.aspx"" target=""main"">文章专题分类</a></li>");
            sb.AppendLine(@"</ul>");
            return sb.ToString();
        }

        private string Bind_Admin_User() {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>管理员管理</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""Admin/Admin_Admin.aspx"" target=""main"">管理员管理</a></li>");
            sb.AppendLine(@"<li><a href=""Admin/Admin_AdminRole.aspx"" target=""main"">管理员角色</a></li>");
            sb.AppendLine(@"<li><a href=""Admin/Admin_Admin.aspx?Action=edit&AID=" + CookieHelper.GetValue("adminid") + @""" target=""main"">修改密码</a></li>");
            sb.AppendLine(@"</ul>");
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>用户管理</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""User/Admin_User.aspx"" target=""main"">用户管理</a></li>");
            sb.AppendLine(@"<li><a href=""User/Admin_UserRole.aspx"" target=""main"">用户等级管理</a></li>");
            sb.AppendLine(@"</ul>");
            return sb.ToString();
        }


        private string Bind_Admin_Template() {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine(@"<h6 class='submenuheader'><a href='#'>模板静态</a></h6>");
            sb.AppendLine(@"<ul class='submenu'>");
            sb.AppendLine(@"<li><a href=""Tools/Admin_Template.aspx"" target=""main"">模板管理</a></li>");
            sb.AppendLine(@"<li><a href=""Html/Admin_Html.aspx"" target=""main"">生成静态</a></li>");
            sb.AppendLine(@"</ul>");
            return sb.ToString();
        }
    }
}
